#include <vector>
#include <map>
#include <iostream>
using namespace std;
int main (int argc, char ** argu){

 vector <int> v;
 map <int, int> m;
 int j;

 while (1) {
  cout << "number" << endl;
  cin >>j;
  if (0==j)break;
  v.push_back(j);
 }
 
for (int i=0; i < v.size(); i++){
 if (m.find(v[i])!=m.end())
 m[v[i]]++;
 else
 m[v[i]]=1;
}
map <int,int>:: iterator it=m.begin();
while (m.end()!=it){
 cout <<it->first<<" "<<it->second << endl;
 it++;
}

return 0;
}
